package cn.edu.nyist.integration.mapper;

import cn.edu.nyist.integration.entity.Integration;
import cn.edu.nyist.integration.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {
    int deleteByPrimaryKey(String id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    int selectByUsername(String username);

    User selectLogin(@Param("username") String username, @Param("password") String password);

    /*根据用户名查userID*/
    String selectIdByUsername(String username);

    int checkEmail(String email);

    int checkEmailByUserId(@Param("email") String email, @Param("id") String id);

    User selectByQuestionAndAnswer(@Param("question") String question,@Param("answer") String answer,@Param("id") String id);

    int checkPassword(@Param("password") String password, @Param("id") String id);

    int checkStatus(@Param("username")String username);

    List<User> selectAll(@Param("username") String username,@Param("role") Integer role);

    int updateByUsername(@Param("username")String username,@Param("phone") String phone,@Param("status") Integer status);

    int updateLoginTime();
}